package StringDemo.SubString;

public class IdentityInfo {
    public static void main(String[] args) {
        String identity = "12345620230519123";
        String[] birth = birth(identity);
        for (String s : birth) {
            System.out.print(s + " ");
        }
    }

    public static String[] birth(String identity){
        String[] result = new String[4];
        result[0] = identity.substring(6,10);
        result[1] = identity.substring(10,12);
        result[2] = identity.substring(12,14);
        if((int)identity.charAt(16) % 2 == 0)
            result[3] = "女";
        else
            result[3] = "男";
        return result;
    }
}
